<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>钓鱼日志 - 鱼情助手</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        .glass-effect {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }
        .progress-bar {
            transition: width 0.3s ease;
        }
    </style>
</head>
<body class="min-h-screen">
    <!-- 顶部导航 -->
    <div class="fixed top-0 left-0 right-0 z-50 glass-effect">
        <div class="flex items-center justify-between p-4">
            <a href="index.html" class="text-white text-xl">
                <i class="fas fa-arrow-left"></i>
            </a>
            <h1 class="text-white text-lg font-semibold">钓鱼日志</h1>
            <div class="flex items-center space-x-2">
                <button onclick="exportData()" class="text-white text-xl">
                    <i class="fas fa-download"></i>
                </button>
                <button onclick="openSearch()" class="text-white text-xl">
                    <i class="fas fa-search"></i>
                </button>
            </div>
        </div>
    </div>

    <!-- 主要内容 -->
    <div class="pt-20 pb-24 px-4">
        <!-- 快速操作按钮 -->
        <div class="grid grid-cols-4 gap-3 mb-6">
            <button class="glass-effect rounded-xl p-3 text-center card-hover text-white" onclick="openNewLogModal()">
                <i class="fas fa-plus text-xl mb-1 text-green-300"></i>
                <div class="text-xs font-medium">新增记录</div>
            </button>
            <button class="glass-effect rounded-xl p-3 text-center card-hover text-white" onclick="openCameraModal()">
                <i class="fas fa-camera text-xl mb-1 text-purple-300"></i>
                <div class="text-xs font-medium">拍照识别</div>
            </button>
            <button class="glass-effect rounded-xl p-3 text-center card-hover text-white" onclick="openTemplates()">
                <i class="fas fa-clipboard-list text-xl mb-1 text-blue-300"></i>
                <div class="text-xs font-medium">模板</div>
            </button>
            <a href="history.html" class="glass-effect rounded-xl p-3 text-center card-hover text-white block">
                <i class="fas fa-history text-xl mb-1 text-orange-300"></i>
                <div class="text-xs font-medium">历史记录</div>
            </a>
        </div>

        <!-- 今日统计（增强版） -->
        <div class="glass-effect rounded-2xl p-4 mb-6 text-white">
            <div class="flex items-center justify-between mb-4">
                <h2 class="text-lg font-semibold">今日钓鱼</h2>
                <button onclick="refreshStats()" class="text-sm text-blue-300">
                    <i class="fas fa-sync-alt mr-1"></i>刷新
                </button>
            </div>
            <div class="grid grid-cols-2 gap-4 mb-4">
                <div class="text-center">
                    <div class="text-2xl font-bold text-green-300" id="today-count">3</div>
                    <div class="text-sm opacity-80">总数量</div>
                </div>
                <div class="text-center">
                    <div class="text-2xl font-bold text-blue-300" id="today-species">2</div>
                    <div class="text-sm opacity-80">种类</div>
                </div>
                <div class="text-center">
                    <div class="text-2xl font-bold text-yellow-300" id="today-weight">2.5</div>
                    <div class="text-sm opacity-80">重量(kg)</div>
                </div>
                <div class="text-center">
                    <div class="text-2xl font-bold text-purple-300" id="today-hours">2.5</div>
                    <div class="text-sm opacity-80">时长(h)</div>
                </div>
            </div>
            
            <!-- 今日目标进度 -->
            <div class="border-t border-white/20 pt-3">
                <div class="flex items-center justify-between mb-2">
                    <span class="text-sm">今日目标进度</span>
                    <span class="text-sm" id="goal-progress">3/5</span>
                </div>
                <div class="w-full bg-white/20 rounded-full h-2">
                    <div class="bg-green-400 h-2 rounded-full progress-bar" style="width: 60%" id="progress-bar"></div>
                </div>
            </div>
        </div>

        <!-- 钓鱼技巧和建议（增强版） -->
        <div class="glass-effect rounded-2xl p-4 mb-6 text-white">
            <h2 class="text-lg font-semibold mb-4">智能建议</h2>
            <div class="space-y-3">
                <div class="bg-white/10 rounded-xl p-3">
                    <div class="flex items-center space-x-2 mb-2">
                        <i class="fas fa-lightbulb text-yellow-300"></i>
                        <span class="font-medium">今日建议</span>
                        <span class="text-xs bg-green-500/30 px-2 py-1 rounded-full">新</span>
                    </div>
                    <p class="text-sm opacity-80">当前天气晴朗，微风，适合浅水区钓鱼。建议使用小钩细线，饵料选择蚯蚓或玉米粒。</p>
                </div>
                <div class="bg-white/10 rounded-xl p-3">
                    <div class="flex items-center space-x-2 mb-2">
                        <i class="fas fa-fish text-blue-300"></i>
                        <span class="font-medium">鱼种推荐</span>
                    </div>
                    <p class="text-sm opacity-80">当前季节和天气条件下，鲫鱼和草鱼活跃度较高，建议重点关注。</p>
                </div>
                <div class="bg-white/10 rounded-xl p-3">
                    <div class="flex items-center space-x-2 mb-2">
                        <i class="fas fa-clock text-orange-300"></i>
                        <span class="font-medium">最佳时段</span>
                    </div>
                    <p class="text-sm opacity-80">根据历史数据，16:00-18:00是今日最佳钓鱼时段。</p>
                </div>
            </div>
        </div>

        <!-- 最近记录（增强版） -->
        <div class="glass-effect rounded-2xl p-4 mb-6 text-white">
            <div class="flex items-center justify-between mb-4">
                <h2 class="text-lg font-semibold">最近记录</h2>
                <div class="flex items-center space-x-2">
                    <button onclick="filterRecords()" class="text-sm text-blue-300">
                        <i class="fas fa-filter mr-1"></i>筛选
                    </button>
                    <a href="history.html" class="text-sm text-blue-300">查看全部</a>
                </div>
            </div>
            
            <!-- 记录列表 -->
            <div class="space-y-3" id="recent-records">
                <div class="bg-white/10 rounded-xl p-3 card-hover">
                    <div class="flex items-center space-x-3">
                        <img src="https://images.unsplash.com/photo-1544552866-d3ed42536cfd?w=60&h=60&fit=crop&crop=face" 
                             class="w-12 h-12 rounded-lg object-cover">
                        <div class="flex-1">
                            <div class="font-medium">草鱼</div>
                            <div class="text-sm opacity-80">杭州西湖 · 今天 14:30</div>
                            <div class="text-xs opacity-60">1.2kg · 晴天 · 微风 · 玉米粒</div>
                        </div>
                        <div class="text-right">
                            <div class="text-sm font-medium">收获</div>
                            <div class="text-xs opacity-80">1条</div>
                            <button onclick="editRecord(1)" class="text-xs text-blue-300 mt-1">
                                <i class="fas fa-edit"></i>
                            </button>
                        </div>
                    </div>
                </div>

                <div class="bg-white/10 rounded-xl p-3 card-hover">
                    <div class="flex items-center space-x-3">
                        <img src="https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=60&h=60&fit=crop" 
                             class="w-12 h-12 rounded-lg object-cover">
                        <div class="flex-1">
                            <div class="font-medium">鲫鱼</div>
                            <div class="text-sm opacity-80">杭州西湖 · 今天 12:15</div>
                            <div class="text-xs opacity-60">0.8kg · 晴天 · 微风 · 蚯蚓</div>
                        </div>
                        <div class="text-right">
                            <div class="text-sm font-medium">收获</div>
                            <div class="text-xs opacity-80">2条</div>
                            <button onclick="editRecord(2)" class="text-xs text-blue-300 mt-1">
                                <i class="fas fa-edit"></i>
                            </button>
                        </div>
                    </div>
                </div>

                <div class="bg-white/10 rounded-xl p-3 card-hover">
                    <div class="flex items-center space-x-3">
                        <img src="https://images.unsplash.com/photo-1535591273668-578e31182c4f?w=60&h=60&fit=crop" 
                             class="w-12 h-12 rounded-lg object-cover">
                        <div class="flex-1">
                            <div class="font-medium">黑鱼</div>
                            <div class="text-sm opacity-80">西溪湿地 · 昨天 16:20</div>
                            <div class="text-xs opacity-60">1.5kg · 多云 · 二级风 · 路亚</div>
                        </div>
                        <div class="text-right">
                            <div class="text-sm font-medium">收获</div>
                            <div class="text-xs opacity-80">1条</div>
                            <button onclick="editRecord(3)" class="text-xs text-blue-300 mt-1">
                                <i class="fas fa-edit"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 快速数据入口 -->
        <div class="glass-effect rounded-2xl p-4 text-white">
            <h2 class="text-lg font-semibold mb-4">数据分析</h2>
            <div class="grid grid-cols-2 gap-3">
                <a href="history.html" class="bg-white/10 rounded-xl p-3 card-hover block">
                    <div class="flex items-center space-x-2 mb-2">
                        <i class="fas fa-chart-bar text-blue-300"></i>
                        <span class="font-medium">统计报告</span>
                    </div>
                    <div class="text-xs opacity-80">查看详细的钓鱼数据统计</div>
                </a>
                <button onclick="openTrendAnalysis()" class="bg-white/10 rounded-xl p-3 card-hover text-left">
                    <div class="flex items-center space-x-2 mb-2">
                        <i class="fas fa-chart-line text-green-300"></i>
                        <span class="font-medium">趋势分析</span>
                    </div>
                    <div class="text-xs opacity-80">分析钓鱼成功率趋势</div>
                </button>
            </div>
        </div>
    </div>

    <!-- 新增记录模态框（增强版） -->
    <div id="newLogModal" class="fixed inset-0 z-50 hidden">
        <div class="absolute inset-0 bg-black/50" onclick="closeNewLogModal()"></div>
        <div class="absolute bottom-0 left-0 right-0 bg-white rounded-t-3xl p-6 max-h-[90vh] overflow-y-auto">
            <div class="flex items-center justify-between mb-6">
                <h3 class="text-xl font-semibold">新增钓鱼记录</h3>
                <div class="flex items-center space-x-2">
                    <button onclick="saveAsDraft()" class="text-sm text-gray-600">
                        <i class="fas fa-save mr-1"></i>草稿
                    </button>
                    <button onclick="closeNewLogModal()" class="text-gray-400 text-xl">
                        <i class="fas fa-times"></i>
                    </button>
                </div>
            </div>
            
            <form class="space-y-4" id="fishing-log-form">
                <!-- 基础信息 -->
                <div class="border-b border-gray-200 pb-4">
                    <h4 class="font-medium text-gray-800 mb-3">基础信息</h4>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">钓鱼地点</label>
                            <div class="relative">
                                <input type="text" placeholder="输入地点名称" class="w-full p-3 border border-gray-300 rounded-lg pr-10">
                                <button type="button" onclick="getCurrentLocation()" class="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400">
                                    <i class="fas fa-map-marker-alt"></i>
                                </button>
                            </div>
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">钓点类型</label>
                            <select class="w-full p-3 border border-gray-300 rounded-lg">
                                <option>湖泊</option>
                                <option>河流</option>
                                <option>海边</option>
                                <option>池塘</option>
                                <option>水库</option>
                            </select>
                        </div>
                    </div>
                    
                    <div class="grid grid-cols-2 gap-4 mt-4">
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">开始时间</label>
                            <input type="datetime-local" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">结束时间</label>
                            <input type="datetime-local" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                    </div>
                    
                    <div class="grid grid-cols-2 gap-4 mt-4">
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">水深(米)</label>
                            <input type="number" step="0.1" placeholder="1.5" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">水温(°C)</label>
                            <input type="number" placeholder="18" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                    </div>
                </div>

                <!-- 鱼获记录 -->
                <div class="border-b border-gray-200 pb-4">
                    <div class="flex items-center justify-between mb-3">
                        <h4 class="font-medium text-gray-800">鱼获记录</h4>
                        <button type="button" onclick="addFishRecord()" class="text-sm text-blue-600">
                            <i class="fas fa-plus mr-1"></i>添加鱼种
                        </button>
                    </div>
                    
                    <div id="fish-records">
                        <div class="fish-record-item border border-gray-200 rounded-lg p-3 mb-3">
                            <div class="grid grid-cols-2 gap-4">
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-2">鱼种</label>
                                    <select class="w-full p-2 border border-gray-300 rounded-lg">
                                        <option>选择鱼种</option>
                                        <option>草鱼</option>
                                        <option>鲫鱼</option>
                                        <option>鲤鱼</option>
                                        <option>黑鱼</option>
                                        <option>鲈鱼</option>
                                        <option>其他</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-2">数量</label>
                                    <input type="number" placeholder="1" class="w-full p-2 border border-gray-300 rounded-lg">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-2">单条重量(kg)</label>
                                    <input type="number" step="0.1" placeholder="1.2" class="w-full p-2 border border-gray-300 rounded-lg">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-2">长度(cm)</label>
                                    <input type="number" placeholder="25" class="w-full p-2 border border-gray-300 rounded-lg">
                                </div>
                            </div>
                            <div class="mt-3 flex items-center space-x-4">
                                <label class="flex items-center">
                                    <input type="checkbox" class="mr-2">
                                    <span class="text-sm">放生</span>
                                </label>
                                <button type="button" onclick="uploadFishPhoto()" class="text-sm text-blue-600">
                                    <i class="fas fa-camera mr-1"></i>拍照
                                </button>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 钓具装备 -->
                <div class="border-b border-gray-200 pb-4">
                    <h4 class="font-medium text-gray-800 mb-3">钓具装备</h4>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">鱼竿</label>
                            <input type="text" placeholder="如：4.5米碳素竿" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">鱼线</label>
                            <input type="text" placeholder="如：3号尼龙线" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">鱼钩</label>
                            <input type="text" placeholder="如：6号伊势尼" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">浮漂</label>
                            <input type="text" placeholder="如：2号芦苇漂" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                    </div>
                    
                    <div class="mt-4">
                        <label class="block text-sm font-medium text-gray-700 mb-2">饵料配方</label>
                        <textarea placeholder="记录使用的饵料和配比..." rows="2" class="w-full p-3 border border-gray-300 rounded-lg"></textarea>
                    </div>
                </div>

                <!-- 环境天气 -->
                <div class="border-b border-gray-200 pb-4">
                    <h4 class="font-medium text-gray-800 mb-3">环境天气</h4>
                    <div class="grid grid-cols-4 gap-2 mb-4">
                        <button type="button" class="p-2 border border-gray-300 rounded-lg text-center weather-btn" data-weather="晴天">
                            <i class="fas fa-sun text-yellow-500"></i>
                            <div class="text-xs mt-1">晴天</div>
                        </button>
                        <button type="button" class="p-2 border border-gray-300 rounded-lg text-center weather-btn" data-weather="多云">
                            <i class="fas fa-cloud text-gray-500"></i>
                            <div class="text-xs mt-1">多云</div>
                        </button>
                        <button type="button" class="p-2 border border-gray-300 rounded-lg text-center weather-btn" data-weather="阴天">
                            <i class="fas fa-cloud-sun text-gray-600"></i>
                            <div class="text-xs mt-1">阴天</div>
                        </button>
                        <button type="button" class="p-2 border border-gray-300 rounded-lg text-center weather-btn" data-weather="小雨">
                            <i class="fas fa-cloud-rain text-blue-500"></i>
                            <div class="text-xs mt-1">小雨</div>
                        </button>
                    </div>
                    
                    <div class="grid grid-cols-3 gap-4">
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">风力等级</label>
                            <select class="w-full p-3 border border-gray-300 rounded-lg">
                                <option>无风</option>
                                <option>1-2级</option>
                                <option>3-4级</option>
                                <option>5-6级</option>
                                <option>7级以上</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">气压(hPa)</label>
                            <input type="number" placeholder="1013" class="w-full p-3 border border-gray-300 rounded-lg">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">能见度</label>
                            <select class="w-full p-3 border border-gray-300 rounded-lg">
                                <option>优秀</option>
                                <option>良好</option>
                                <option>一般</option>
                                <option>较差</option>
                            </select>
                        </div>
                    </div>
                </div>
                
                <!-- 心得备注 -->
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">钓鱼心得</label>
                    <textarea placeholder="记录钓鱼心得、技巧总结、下次改进等..." rows="3" class="w-full p-3 border border-gray-300 rounded-lg"></textarea>
                </div>
                
                <div class="flex space-x-3 pt-4">
                    <button type="button" onclick="closeNewLogModal()" class="flex-1 py-3 border border-gray-300 rounded-lg text-gray-700">取消</button>
                    <button type="submit" class="flex-1 py-3 bg-blue-500 text-white rounded-lg">保存记录</button>
                </div>
            </form>
        </div>
    </div>

    <!-- 拍照识别模态框 -->
    <div id="cameraModal" class="fixed inset-0 z-50 hidden">
        <div class="absolute inset-0 bg-black/90" onclick="closeCameraModal()"></div>
        <div class="absolute inset-4 bg-white rounded-2xl p-6 flex flex-col">
            <div class="flex items-center justify-between mb-4">
                <h3 class="text-xl font-semibold">鱼种识别</h3>
                <button onclick="closeCameraModal()" class="text-gray-400 text-xl">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            
            <div class="flex-1 bg-gray-100 rounded-lg flex items-center justify-center mb-4">
                <div class="text-center text-gray-500">
                    <i class="fas fa-camera text-4xl mb-2"></i>
                    <div>点击拍照或选择图片</div>
                </div>
            </div>
            
            <div class="flex space-x-3">
                <button class="flex-1 py-3 bg-blue-500 text-white rounded-lg">
                    <i class="fas fa-camera mr-2"></i>拍照
                </button>
                <button class="flex-1 py-3 border border-gray-300 rounded-lg">
                    <i class="fas fa-image mr-2"></i>相册
                </button>
            </div>
        </div>
    </div>

    <!-- 底部导航栏 -->
    <div class="fixed bottom-0 left-0 right-0 bg-white/90 backdrop-blur-lg border-t border-gray-200">
        <div class="flex items-center justify-around p-2">
            <a href="index.html" class="flex flex-col items-center p-2 text-gray-400">
                <i class="fas fa-home text-xl"></i>
                <span class="text-xs mt-1">首页</span>
            </a>
            <button class="flex flex-col items-center p-2 text-gray-400">
                <i class="fas fa-map text-xl"></i>
                <span class="text-xs mt-1">地图</span>
            </button>
            <button class="flex flex-col items-center p-2 text-blue-500">
                <i class="fas fa-plus-circle text-2xl"></i>
                <span class="text-xs">记录</span>
            </button>
            <button class="flex flex-col items-center p-2 text-gray-400">
                <i class="fas fa-bell text-xl"></i>
                <span class="text-xs mt-1">通知</span>
            </button>
            <button class="flex flex-col items-center p-2 text-gray-400">
                <i class="fas fa-user text-xl"></i>
                <span class="text-xs mt-1">我的</span>
            </button>
        </div>
    </div>

    <script>
        // 新增的JavaScript功能
        function addFishRecord() {
            const container = document.getElementById('fish-records');
            const newRecord = container.firstElementChild.cloneNode(true);
            
            // 清空新记录的输入值
            newRecord.querySelectorAll('input, select').forEach(input => {
                if (input.type === 'checkbox') {
                    input.checked = false;
                } else {
                    input.value = '';
                }
            });
            
            // 添加删除按钮
            const deleteBtn = document.createElement('button');
            deleteBtn.type = 'button';
            deleteBtn.className = 'text-sm text-red-600 ml-4';
            deleteBtn.innerHTML = '<i class="fas fa-trash mr-1"></i>删除';
            deleteBtn.onclick = function() {
                newRecord.remove();
            };
            
            newRecord.querySelector('.mt-3').appendChild(deleteBtn);
            container.appendChild(newRecord);
        }

        function getCurrentLocation() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(function(position) {
                    // 这里可以根据经纬度获取地址信息
                    alert('已获取当前位置');
                });
            } else {
                alert('浏览器不支持定位功能');
            }
        }

        function uploadFishPhoto() {
            // 调用拍照或选择照片功能
            alert('打开相机拍照');
        }

        function saveAsDraft() {
            alert('已保存为草稿');
        }

        function refreshStats() {
            // 刷新今日统计数据
            console.log('刷新统计数据');
        }

        function exportData() {
            alert('导出钓鱼数据');
        }

        function openSearch() {
            alert('打开搜索功能');
        }

        function openTemplates() {
            alert('打开记录模板');
        }

        function filterRecords() {
            alert('打开记录筛选');
        }

        function editRecord(id) {
            alert(`编辑记录 ${id}`);
        }

        function openTrendAnalysis() {
            alert('打开趋势分析');
        }

        function openNewLogModal() {
            document.getElementById('newLogModal').classList.remove('hidden');
        }

        function closeNewLogModal() {
            document.getElementById('newLogModal').classList.add('hidden');
        }

        function openCameraModal() {
            document.getElementById('cameraModal').classList.remove('hidden');
        }

        function closeCameraModal() {
            document.getElementById('cameraModal').classList.add('hidden');
        }

        // 天气选择按钮
        document.querySelectorAll('.weather-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                document.querySelectorAll('.weather-btn').forEach(b => {
                    b.classList.remove('bg-blue-100', 'border-blue-500');
                });
                this.classList.add('bg-blue-100', 'border-blue-500');
            });
        });

        // 表单提交处理
        document.getElementById('fishing-log-form').addEventListener('submit', function(e) {
            e.preventDefault();
            
            // 收集表单数据
            const formData = new FormData(this);
            
            // 处理数据保存
            console.log('保存钓鱼记录');
            
            // 关闭模态框
            closeNewLogModal();
            
            // 更新今日统计
            refreshStats();
            
            alert('钓鱼记录保存成功！');
        });

        // 模拟数据更新
        function updateTodayStats() {
            // 这里可以连接真实的数据API
            const stats = {
                count: Math.floor(Math.random() * 10),
                species: Math.floor(Math.random() * 5) + 1,
                weight: (Math.random() * 10).toFixed(1),
                hours: (Math.random() * 8).toFixed(1)
            };
            
            document.getElementById('today-count').textContent = stats.count;
            document.getElementById('today-species').textContent = stats.species;
            document.getElementById('today-weight').textContent = stats.weight;
            document.getElementById('today-hours').textContent = stats.hours;
            
            // 更新目标进度
            const goal = 5; // 假设目标是5条鱼
            const progress = Math.min((stats.count / goal) * 100, 100);
            document.getElementById('goal-progress').textContent = `${stats.count}/${goal}`;
            document.getElementById('progress-bar').style.width = `${progress}%`;
        }

        // 页面加载时更新统计数据
        updateTodayStats();
    </script>
</body>
</html> 